<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    <h:head>
        <title>Currencies Converter</title>
    </h:head>
    <h:body>
        <h:form>
            <h3>Convert currencies</h3>
            <!--<p>
                <h:outputLabel for="fromCurrency" value="From: "/>
                <h:selectOneListbox id="fromCurrency" value="#{conversionManager.fromCurrency}">
                    <f:selectItem id="eur" itemLabel="EUR" itemValue="EUR" />
                    <f:selectItem id="sek" itemLabel="SEK" itemValue="SEK" />
                    <f:selectItem id="usd" itemLabel="USD" itemValue="USD" />
                    <f:selectItem id="gbp" itemLabel="GBP" itemValue="GBP" />
                </h:selectOneListbox>

            </p>
            <p>
                <h:outputLabel for="toCurrency" value="To: "/>
                <h:selectOneListbox id="toCurrency" value="#{conversionManager.toCurrency}">
                    <f:selectItem id="eur2" itemLabel="EUR" itemValue="EUR" />
                    <f:selectItem id="sek2" itemLabel="SEK" itemValue="SEK" />
                    <f:selectItem id="usd2" itemLabel="USD" itemValue="USD" />
                    <f:selectItem id="gbp2" itemLabel="GBP" itemValue="GBP" />
                </h:selectOneListbox>

            </p>-->
            
            <p>
                <h:outputLabel for="from" value="from "/>
                <h:inputText id="from" value="#{conversionManager.fromCurrency}" />
            </p>
            
            <p>
                <h:outputLabel for="to" value="to "/>
                <h:inputText id="to" value="#{conversionManager.toCurrency}" />
            </p>
            
            
            <p>
                <h:outputLabel for="amount" value="Amount: "/>
                <h:inputText id="amount" value="#{conversionManager.amount}" />
            </p>

            <p>
                <h:commandButton value="Convert" action="#{conversionManager.convert}"/>
            </p>
            <hr/>


        </h:form>

        <h:outputLabel for="amountConverted"
                       rendered="#{conversionManager.amountConverted!= null}"
                       value="Amount converted: "/>
        <h:outputText id="amountConverted"
                      value="#{conversionManager.amountConverted}"/>
    </h:body>
</html>

